﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using OnlineEducation.Data;

namespace OnlineEducation.Helpers
{
    public class TeacherHelper
    {
        private TeacherHelper() { }
        private static TeacherHelper teacherHelper;
        public static TeacherHelper GetInstatnce()
        {
            if (teacherHelper == null)
                teacherHelper = new TeacherHelper();
            return teacherHelper;
        }

        public int GetStudentCountByTeachPlanId(int teachPlanId, ApplicationDbContext dbContext)
        {
            var studentCount = dbContext.Bookings.Where(r => r.TeachingPlanId == teachPlanId).Count();
            return studentCount;
        }


    }
}
